import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'   //国际化
import { createPinia } from 'pinia'
import.meta.env
import axios from "axios";


const app = createApp(App);
// 实例化 Pinia
const pinia = createPinia()

app.use(ElementPlus,{locale: zhCn}).use(router).use(pinia).mount('#app')

//全局注册图标组件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

import { createApp } from 'vue'
import App from './App.vue'
//引入element-plus插件与样式
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
//配置element-plus国际化
//@ts-ignore
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

//svg插件需要配置代码
import 'virtual:svg-icons-register'
  
// 引入svg组件
import SvgIcon from '@/components/SvgIcon/index.vue'

// 引入自定义插件对象：注册整个项目全局组件，比如分页器、svg组件
import globalComponent from '@/components'

// 引入模板的全局的样式
import '@/styles/index.scss'

// 引入路由
import router from './router'

//获取应用实例对象
const app = createApp(App)

//安装element-plus插件
app.use(ElementPlus,{
  locale:zhCn //国际化设置
});

//安装自定义插件
app.use(globalComponent);

// 注册模板路由
app.use(router);

//将应用挂在到挂在点上
app.mount('#app')